<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
       
    </style>
</head>
<body>
    <!-- <script src="js/common.js"></script> -->
    <input type="text"><br>
    <input type="text"><br>
    <input type="text"><br>
    <input type="text"><br>
    <input type="text"><br>
    <input type="text"><br>
    <input type="text"><br>
    <button id="btn">按钮</button>   
    <script>
        // var btn = my$("btn");
        var ipts = document.getElementsByTagName("input");
        for(var i = 0; i < ipts.length; i++){
            ipts[i].onfocus = function(){
                for(var j = 0;j < ipts.length; j++){
                    ipts[j].style.backgroundColor = "";
                }
            this.style.backgroundColor = "blue";
            }
        }
    
    </script>   
</body>
</html>